package com.yuyue.dronesystem.beans;

import java.util.Objects;

import com.yuyue.dronesystem.enums.PlaceType;

/**
 * Site
 */
public class Site extends Coordinate {

    // 地点名称
    private String name = "";
    // 地点介绍
    private String note = "";
    // 地点类型
    private PlaceType type = PlaceType.OTHER;
    
    public Site() {
    }

    public Site(String name, String note, PlaceType type) {
        this.name = name;
        this.note = note;
        this.type = type;
    }

    public Site(Double longitude, Double latitude, Double altitude, String name,  String note, PlaceType type) {
        super(longitude, latitude, altitude);
        this.name = name;
        this.note = note;
        this.type = type;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNote() {
        return this.note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public PlaceType getType() {
        return this.type;
    }

    public void setType(PlaceType type) {
        this.type = type;
    }

    public Site name(String name) {
        this.name = name;
        return this;
    }

    public Site note(String note) {
        this.note = note;
        return this;
    }

    public Site type(PlaceType type) {
        this.type = type;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof Site)) {
            return false;
        }
        Site site = (Site) o;
        return super.equals((Coordinate) o) && Objects.equals(name, site.name) && Objects.equals(type, site.type) && Objects.equals(note, site.note);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), name, type, note);
    }

    @Override
    public String toString() {
        return "{" +
            " coor='" + super.toString() + "'" +
            ", name='" + getName() + "'" +
            ", type='" + getType() + "'" +
            ", note='" + getNote() + "'" +
            "}";
    }    
}